package cn.com.huzo.model.entities.purchase;

import com.fasterxml.jackson.annotation.JsonFormat;
import huzofw.model.entities.BaseEntity;
import huzofw.model.entities.IAggregateRoot;
import java.io.Serializable;
import java.sql.Timestamp;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 采购下单通知实体类
 *
 * @author 吴旭
 */
public class PoNoticeEntity extends BaseEntity implements Serializable, IAggregateRoot {

    private static final long serialVersionUID = 5603944198475140970L;
    private String PoNoticeId;
    private Long PurchasedBy;               // 采购担当标识
    private String PurchasedByName;         // 采购担当名
    private Long MrpId;                     // 审核后的物料需求表标识（调达主辅料、补料单）
    private String StyleNo;                 // 产品款号
    private String ReceiptedFlag;           // 已阅标记
    private Timestamp MrpDate;              // 调达日期最后操作日期
    private Timestamp NoticeDate;           // 通知日期
    private String OverFlag;                // 采购担当完成情况标记
    private Float PoProgress;               // 该款采购完成进度
    private Short BillType;                 // 单据类型 0：提前 1：定版 2：辅资材 3：补料单

    public String getPoNoticeId() {
        return PoNoticeId;
    }

    public void setPoNoticeId(String PoNoticeId) {
        this.PoNoticeId = PoNoticeId;
    }

    public Long getPurchasedBy() {
        return PurchasedBy;
    }

    public void setPurchasedBy(Long PurchasedBy) {
        this.PurchasedBy = PurchasedBy;
    }

    public String getPurchasedByName() {
        return PurchasedByName;
    }

    public void setPurchasedByName(String PurchasedByName) {
        this.PurchasedByName = PurchasedByName;
    }

    public Long getMrpId() {
        return MrpId;
    }

    public void setMrpId(Long MrpId) {
        this.MrpId = MrpId;
    }

    public String getStyleNo() {
        return StyleNo;
    }

    public void setStyleNo(String StyleNo) {
        this.StyleNo = StyleNo;
    }

    public String getReceiptedFlag() {
        return ReceiptedFlag;
    }

    public void setReceiptedFlag(String ReceiptedFlag) {
        this.ReceiptedFlag = ReceiptedFlag;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    public Timestamp getMrpDate() {
        return MrpDate;
    }

    public void setMrpDate(Timestamp MrpDate) {
        this.MrpDate = MrpDate;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    public Timestamp getNoticeDate() {
        return NoticeDate;
    }

    public void setNoticeDate(Timestamp NoticeDate) {
        this.NoticeDate = NoticeDate;
    }

    public String getOverFlag() {
        return OverFlag;
    }

    public void setOverFlag(String OverFlag) {
        this.OverFlag = OverFlag;
    }

    public Float getPoProgress() {
        return PoProgress;
    }

    public void setPoProgress(Float PoProgress) {
        this.PoProgress = PoProgress;
    }

    public Short getBillType() {
        return BillType;
    }

    public void setBillType(Short BillType) {
        this.BillType = BillType;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof PoNoticeEntity)) {
            return false;
        }

        final PoNoticeEntity that = (PoNoticeEntity) o;

        return new EqualsBuilder()
                .append(this.getPoNoticeId(), that.getPoNoticeId())
                .isEquals();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public int hashCode() {
        int result = 17;
        result = 31 * result + this.getPoNoticeId().hashCode();

        return result;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }
}
